﻿/*
字符棱形 
Time Limit:1000MS  Memory Limit:32768K


Description:
根据读入的字符和边长，勾画字符棱形。

Input:
输入数据含有不超过50组的数据，每组数据包括一个可见字符c和一个整数n（1≤n≤30）。 
Output:
输出以c为填充字符，边长为n的棱形，勾画每个棱形时都应另起一行。 
Sample Input:
A 5 B 3

Sample Output:
    A
   AAA
  AAAAA
 AAAAAAA
AAAAAAAAA
 AAAAAAA
  AAAAA
   AAA
    A
  B
 BBB
BBBBB
 BBB
  B

*/

#include <stdio.h>
#include <string.h>
#define MAX_CHARS 128
#define MAX_ELEMS 64


void diamond(char ch, unsigned n)
{
	unsigned m=(n<<1)-1;
	unsigned i;
	for (i=1; i<=m; ++i)
	{	
		char buff[MAX_CHARS]={0};
		unsigned k=i;
		if(k>=n)k=m-i+1;
		memset(buff, ch, (k<<1)-1);
		printf("%*s\n", n-k+(k<<1)-1, buff);
	}

}
int main(int argc, char* argv[])
{
	int ch[MAX_ELEMS];
	unsigned n[MAX_ELEMS];
	unsigned i=0u, k=0u;
	while (EOF!=scanf("%c%u", ch+k, n+k) && n[k]<31 &&k<50)
	{
		++k;
		getchar();
	}
	for (i=0; i<k; ++i)
		diamond(ch[i], n[i]);

	return 0;
}